<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head lang="en" th:replace="include/common/common :: commonHeader">
    <footer th:include="include/common/common :: layUiResource"></footer>
    <footer th:include="include/common/common :: blueCSSResource"></footer>
    <footer th:include="include/common/common :: zTreeCSSSource"></footer>
    <footer th:include="include/common/common :: zTreeJSSource"></footer>
    <script>
        layui.config({
            base: '/staticResource/layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index','form','laydate', 'table'] , function () {
            var admin = layui.admin
                ,element = layui.element
                ,laydate = layui.laydate
                ,table = layui.table
                ,form = layui.form;

            element.render();
            //日期
            laydate.render({
                elem: '#buyDate'
            });

            let entityName = 'fixed'
                ,isSafe = false;

            $(document).on('click','.zTreeBtn' , function () {
                if (!isSafe){
                    $("#zTreeOption").val($(this).attr('data'));
                    let elementId = $(this).attr('id') , data = JSON.parse($(this).attr('data')) , i = '/a/layTips/treeSelectForm?isUpdateTree=false' , t = data.title;
                    $.fn.blueJs.tools.active['layerOpen'].call(this , i , t);
                }
            });

            $(document).ready(function () {
                $.fn.blueJs.tools.formButtonItem(entityName);
            });

            $(document).on('click' , function (event) {
                let targetClass = event.target.className , targetId = event.target.id;
                if (targetClass.indexOf('selectBtn') != -1 && targetId == 'fixedBtn'){
                    let i = "/a/" + entityName + "/depItemUserForm", t = "商品明细";
                    $.fn.blueJs.tools.active['layerOpen'].call(this , i , t);
                }
            });

            window.depItemUserSelect = function (res) {
                $("#code").val(res.code);
                $("#name").val(res.name);
                $('#barcode').val(res.barcode);
            };

            form.on('submit(' + entityName + ')',function () {
                let msg = $.fn.blueJs.tools.formSubmit(this)
                    ,type = 'saveMsg';
                //当你在iframe页面关闭自身时
                let index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                $.fn.blueJs.tools.active[type].call(this , msg , index);
                return false;
            });

        });


    </script>
</head>
<body>
<!--  zTree遮罩层 -->
<input type="hidden" id="zTreeOption" value=""/>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form" id="fixedForm" th:object="${fixed}" method="post" action="/a/fixed/save">
                        <!--<div class="box-body">-->
                        <div class="blue-form-unit">基本信息</div>
                        <input type="hidden" id="fixedId" th:field="*{id}"/>
<!--                        <input type="hidden" name="billTypeLabel" id="billTypeLabel" value="领用出库">-->
                        <input type="hidden" id='isNewRecord' th:field="*{isNewRecord}"/>
<!--                        <input type="hidden" id='billType' th:field="*{billType}"/>-->
                        <input type="hidden" id="status" th:field="*{status}"/>

                        <div class="layui-form-item">
                            <div class="layui-col-md6">
                                <label class="layui-form-label " title=""><span class="blue-required ">*</span>资产编号：</label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" autocomplete="off" lay-verify="required" placeholder="" id="cardNum" th:field="*{cardNum}">
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-col-md6">
                                <label class="layui-form-label " title=""><span class="blue-required ">*</span>资产名称：</label>
                                <div class="blue-tree-line layui-input-block">
                                    <input type="hidden" class="layui-input " autocomplete="off" lay-verify="required" placeholder="" id="code" th:field="*{code}">
                                    <input type="hidden" class="layui-input " autocomplete="off" lay-verify="required" placeholder="" id="barcode" th:field="*{barcode}">
                                    <input type="text" class="layui-input fixedBtn" autocomplete="off" lay-verify="required" placeholder="" id="name" th:field="*{name}">
                                    <label class="blue-tree-icon layui-icon layui-icon-search selectBtn" id="fixedBtn"></label>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-col-md3">
                                <label class="layui-form-label " title=""><span class="blue-required hide">*</span>购买日期：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="buyDate" id="buyDate" placeholder="购买日期" lay-verify="date" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-col-md3">
                                <label class="layui-form-label " title=""><span class="blue-required ">*</span>资产原值：</label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" lay-verify="required" placeholder="" id="oprice" th:field="*{oprice}">
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-col-md3">
                                <label class="layui-form-label " title=""><span class="blue-required ">*</span>使用年限：</label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" autocomplete="off" lay-verify="required" placeholder="" id="useLife" th:field="*{useLife}">
                                </div>
                            </div>

                            <div class="layui-col-md3">
                                <label class="layui-form-label " title=""><span class="blue-required ">*</span>残值率：</label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" autocomplete="off" lay-verify="required" placeholder="" id="rate" th:field="*{rate}">
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-col-md3">
                                <label class="layui-form-label " title=""><span class="blue-required hide">*</span>使用人：</label>
                                <thl:tml type="treeSelect" isShowCode="1" title = "领用人" submitAttributeName="code"
                                         url = "/a/user/treeData" name = "userCode" id = "user" submitValue = "*{user.loginCode}" showValue = "*{user.userName}"
                                         canSelectRoot = "false" canSelectParent = "false"/>
                            </div>

                            <div class="layui-col-md3">
                                <label class="layui-form-label " title=""><span class="blue-required hide">*</span>使用部门：</label>
                                <thl:tml type="treeSelect" isShowCode="1" title = "使用部门" submitAttributeName="code"
                                         url = "/a/fixed/depTreeData" name = "depCode" id = "depItemUser" submitValue = "*{depItemUser.code}" showValue = "*{depItemUser.name}"
                                         canSelectRoot = "false" canSelectParent = "false"/>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-col-md3">
                                <label class="layui-form-label " title=""><span class="blue-required ">*</span>制单人：</label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" autocomplete="off" lay-verify="" placeholder="" readonly id="createBy" th:field="*{createBy}">
                                </div>
                            </div>

                            <div class="layui-col-md3">
                                <label class="layui-form-label " title=""><span class="blue-required ">*</span>制单日期：</label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" autocomplete="off" lay-verify="" placeholder="" readonly id="createDate" th:field="*{createDate}">
                                </div>
                            </div>

                            <div class="layui-col-md3">
                                <label class="layui-form-label " title=""><span class="blue-required ">*</span>记账人：</label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" autocomplete="off" lay-verify="" placeholder="" readonly id="checkBy" th:field="*{checkBy}">
                                </div>
                            </div>

                            <div class="layui-col-md3">
                                <label class="layui-form-label " title=""><span class="blue-required ">*</span>记账日期：</label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" autocomplete="off" lay-verify="" placeholder="" readonly id="checkDate" th:field="*{checkDate}">
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-col-md6">
                                <label class="layui-form-label " title=""><span class="blue-required hide">*</span>备注：</label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" autocomplete="off" lay-verify="required" placeholder="" readonly id="remarks" th:field="*{remarks}">
                                </div>
                            </div>
                        </div>

                        <!-- Form 按钮组-->
                        <div class="layui-form-item layui-layout-admin">
                            <div class="layui-input-block blue-form-button-item"></div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>




